home *** CD-ROM | disk | FTP | other *** search
- on exitFrame
- global level1, buglist, SubBug, CurrentBug, pal, NumofCol, BugColorKey, BugColors, gamefourlevel, cursorset, introplayed, canclicked, bigintrosound, mysound
- resetgame()
- set canclicked to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
- if count(buglist) = 0 then
- set buglist to [1, 2, 3, 4, 5, 6, 7, 8, 9]
- end if
- set randombug to random(count(buglist))
- set CurrentBug to getAt(buglist, randombug)
- deleteAt(buglist, randombug)
- set SubBug to random(3)
- if gamefourlevel = 1 then
- set NumofCol to 4
- else
- set NumofCol to 10
- end if
- set infoOffset to ((CurrentBug - 1) * 9) + ((level1 - 1) * 3) + SubBug
- set stemp to line infoOffset of the text of cast "buginfo"
- set BugColorKey to []
- set BugColors to []
- set howmany to the number of items in stemp
- repeat with xxx = 1 to howmany
- add(BugColorKey, value(item xxx of stemp))
- add(BugColors, 0)
- end repeat
- set pal to []
- set crunch to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
- if level1 = 1 then
- set crunch to [1, 9, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 10, 1, 2, 3, 4, 5, 6, 7]
- end if
- repeat with xxx = 1 to NumofCol
- set sample to random(count(crunch))
- if (level1 = 1) and (getAt(crunch, sample) > 7) then
- set sample to random(count(crunch))
- end if
- repeat while not (getPos(pal, getAt(crunch, sample)) = 0)
- set sample to random(count(crunch))
- end repeat
- add(pal, getAt(crunch, sample))
- deleteAt(crunch, sample)
- end repeat
- puppetSprite(48, 0)
- if level1 = 1 then
- go("Level" & level1 & ".0")
- else
- if bigintrosound = [] then
- set bigintrosound to [1, 2, 3]
- end if
- set intros to getAt(bigintrosound, random(count(bigintrosound)))
- deleteAt(bigintrosound, getPos(bigintrosound, intros))
- set mysound to "large box " & intros
- go("Level" & level1 & ".0")
- end if
- end
-